<?php
/**
 * Created by PhpStorm.
 * User: LiuJiaJun
 * Date: 2018/11/26
 * Time: 20:31
 */

namespace app\storage\model;

use think\Model;

class SupplierStorageModel extends Model
{
    protected $table = 'iwh_supplier_storage';
    protected $pk = 'uuid';

    public function Supplier(){
        return $this->belongsTo('SupplierModel','supplier_uuid','uuid')->bind('company_name');
    }

    /**根据仓库Uuid获取厂商Uuid
     * @param $id
     * @return mixed
     */
    public static function getSupplierUuidByStorageUuid($id){
        $supplierModel = new SupplierModel();
        return $supplierModel->where('supplier_id',$id)->value('uuid');
    }
}



